<script setup lang="ts">
import CommonConfig from "./CommonConfig.vue";
import { type FormDesignerComponents } from "../FormComponentMixin";
const config = defineModel<FormDesignerComponents>("config");
</script>

<template>
  <CommonConfig v-model:config="config" />
  <el-form-item label="是否必填">
    <el-switch v-model="config.props.required" />
  </el-form-item>
  <el-form-item label="文件大小">
    <el-input-number v-model="config.props.size" placeholder="单个文件最大大小(MB)" />
  </el-form-item>
  <el-form-item label="文件个数">
    <el-input-number v-model="config.props.limit" placeholder="可上传的文件个数" />
  </el-form-item>
  <el-form-item label="上传文件">
    <el-checkbox-group v-model="config.props.accept" placeholder="允许上传的文件格式">
      <el-checkbox label="pdf" value=".pdf" />
      <el-checkbox label="doc" value=".doc" />
      <el-checkbox label="docx" value=".docx" />
      <el-checkbox label="xls" value=".xls" />
      <el-checkbox label="xlsx" value=".xlsx" />
      <el-checkbox label="jpg" value=".jpg" />
      <el-checkbox label="jpeg" value=".jpeg" />
      <el-checkbox label="png" value=".png" />
      <el-checkbox label="bmp" value=".bmp" />
    </el-checkbox-group>
  </el-form-item>
</template>

<style lang="scss" scoped></style>
